import request from "../utils/request";
import { loginDataType, registerDataType, } from '../interface'


//登录
export const apiLogin = (data: loginDataType) => {
    return request({
        url: '/api/login',
        method: 'post',
        data
    })
}

// gitee 第三方登录
export const apiGiteeLogin = (data: { code: string }) => {
    return request({
        url: '/api/giteeLogin',
        method: 'post',
        data
    })
}

//注册
export const apiRegister = (data: registerDataType) => {
    return request({
        url: '/api/register',
        method: 'post',
        data
    })
}

//用户
export const apigetUserInfo = () => {
    return request({
        url: '/api/getuserinfo',
    })
}

//获取房源列表数据
export const apiGetHousingList = (data?: any) => {
    return request({
        url: '/api/getHousingList',
        method: 'post',
        data
    })
}

//房源管理添加
export const apihousingAdd=(data:any)=>{
    return request({
        url:'/api/housingadd',
        method:"post",
        data
    })
};

// 获取房源某条数据
export const apiGetHousingItem = (data: any) => {
    return request({
        url: '/api/getHousingItem',
        method: 'post',
        data
    })
}

// 更新房源某条数据
export const apiHousingUpdate = (data: any) => {
    return request({
        url: '/api/housingUpdate',
        method: 'post',
        data
    })
}


//房源管理删除
export const apiHousingDel = (data: { id: number }) => {
    return request({
        url: '/api/housingDelete',
        method: 'post',
        data
    })
}



//获取团购列表数据
export const apiGetGroupList = (data?: any) => {
    return request({
        url: '/api/getGroupList',
        method: 'post',
        data
    })
}


//团购管理删除
export const apiGroupDel = (data: { id: number }) => {
    return request({
        url: '/api/groupDelete',
        method: 'post',
        data
    })
}



//获取订单列表数据
export const apiGetOrderList = (data?: any) => {
    return request({
        url: '/api/getOrderList',
        method: 'post',
        data
    })
}


//订单管理删除
export const apiOrderDel = (data: { id: number }) => {
    return request({
        url: '/api/orderDelete',
        method: 'post',
        data
    })
}



//获取经纪人列表数据
export const apiGetBrokerList = (data?: any) => {
    return request({
        url: '/api/getBrokerList',
        method: 'post',
        data
    })
}


//经纪人管理删除
export const apiBrokerDel = (data: { id: number }) => {
    return request({
        url: '/api/brokerDelete',
        method: 'post',
        data
    })
}





//获取咨询列表数据
export const apiGetConsultList = (data?: any) => {
    return request({
        url: '/api/getConsultList',
        method: 'post',
        data
    })
}


//咨询管理删除
export const apiConsultDel = (data: { id: number }) => {
    return request({
        url: '/api/consultDelete',
        method: 'post',
        data
    })
}

//咨询管理添加
export const apiconsultAdd=(data:any)=>{
    return request({
        url:'/api/consultadd',
        method:"post",
        data
    })
};



//获取直播列表数据
export const apiGetLiveList = (data?: any) => {
    return request({
        url: '/api/getLiveList',
        method: 'post',
        data
    })
}


//直播管理删除
export const apiLiveDel = (data: { id: number }) => {
    return request({
        url: '/api/liveDelete',
        method: 'post',
        data
    })
}